
/*
 * author 李华胜<yehong0000@163.com , www.lihuasheng.com>
 */
(function($){//消息提示共用ui
msgBox={
	//通用样式
 styleCommon:'display:none;height15px;line-height15px;position:fixed;top:50%;left:50%;z-index:1000;padding:2px;border-radius:6px;font-style: oblique;filter:alpha(Opacity=60);box-shadow:0px 5px 15px rgba(0, 0, 0, 0.5);-moz-opacity:0.5;opacity:0.9;',
	//成功提示
		success:function(msg){
			var boxStr='<div id="success" style="background-color:#98fb98;'+this.styleCommon+'">';
			boxStr+='<span class="icon-checkmark-circle" style="font-size:15px;color:#fff;"></span>';
			boxStr+='<span style="funt-size:15px;">'+msg+'</span></div>';
			$('body').append(boxStr);//写入dome
			$('#success').fadeIn('slow');//淡入提示框
			setTimeout("$('#success').fadeOut('slow',$('#success').remove())",5000);//3秒后淡出提示框
			},
	//失败提示
		error:function(msg){
			var boxStr='<div id="error" style="background-color:#fa8072;'+this.styleCommon+'">';
			boxStr+='<span class="icon-cancel-circle" style="font-size:15px;color:#fff;"></span>';
			boxStr+='<span style="funt-size:15px;">'+msg+'</span></div>';
			$('body').append(boxStr);//写入dome
			$('#error').fadeIn('slow');//淡入提示框
			setTimeout("$('#error').fadeOut('slow',$('#error').remove())",5000);//3秒后淡出提示框
			},
	//等待提示
		wait:function(msg){
			var boxStr='<div id="wait" style="background-color:#000000;'+this.styleCommon+'">';
			boxStr+='<span class="icon-spinner" style="font-size:15px;color:#fff;"></span>';
			boxStr+='<span style="funt-size:15px;color:#fff;">'+msg+'</span></div>';
			this.shade();//生成遮罩
			$('body').append(boxStr);//写入dome
            $('#wait').fadeIn();
			},
	//淡出等待提示
	removeWait:function(){
		this.removeShade();
		$('#wait').fadeOut();
		$('#wait').remove();
		},
	//通用弹出窗口
	windowCommon:function(html){
		var boxStr='<div id="windowCommon" style="background-color:#fff;'+this.styleCommon+'">';
		boxStr+=html+'</div>';
		$('body').append(boxStr);//写入dome
		$('#windowCommon').fadeIn('slow');//淡入提示框
		this.shade();//生成遮罩
		},
	removeWindowCommon:function(){
		this.removeShade();
		$('#windowCommon').fadeOut('slow',$('#windowCommon').remove());
		},
	//遮罩层	
		shade:function(){
			$('body').append('<div id="windowBG"></div>');
			$('#windowBG').css( {
			width : $(document).width(),
 			height : $(document).height(),
 			position : 'absolute',
 			top : 0,
 			left : 0,
 			zIndex : 998,
 			opacity : 0.3,
 			filter : 'Alpha(Opacity = 30)',
 			backgroundColor : '#000000'
		} );
			},
	//去除遮罩
		removeShade:function(){
				$( '#windowBG' ).remove();
				}
	}
})(jQuery);
